local sk__feiying = fk.CreateSkill {

  name = "sk__feiying",

  tags = { Skill.Compulsory, },

}



sk__feiying:addEffect("filter", {
  name = "sk__feiying",
  anim_type = "support",
  card_filter = function(self, card, player, isJudgeEvent)
    return player:hasSkill(sk__feiying.name) and player:isWounded() and
        table.contains(player:getCardIds("h"), card.id) and
        card.color == Card.Red and card.type == Card.TypeEquip
  end,
  view_as = function(self, player, to_select)
    local card = Fk:cloneCard("peach", to_select.suit, to_select.number)
    card.skillName = sk__feiying.name
    return card
  end,
})

sk__feiying:addEffect("targetmod", {
  name = "#sk__feiying_targetmod",
  --sk__feiying,
  bypass_times = function(self, player, skill, scope, card)
    return player:hasSkill(sk__feiying.name) and not player:isWounded() and card and card.trueName == "slash" and
        card.color == Card.Black and scope == Player.HistoryPhase
  end,
  bypass_distances = function(self, player, skill, card)
    return player:hasSkill(sk__feiying.name) and not player:isWounded() and card and card.trueName == "slash" and
        card.color == Card.Black
  end,
})

return sk__feiying
